import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
const initScene = (content) => {
    const { scene, camera, renderer } = content
    // 平行光1
    var directionalLight = new THREE.DirectionalLight(0xffffff, 0.6);
    directionalLight.position.set(400, 200, 300);
    scene.add(directionalLight);
    // 平行光2
    var directionalLight2 = new THREE.DirectionalLight(0xffffff, 0.6);
    directionalLight2.position.set(-400, -200, -300);
    scene.add(directionalLight2);
    //环境光
    var ambient = new THREE.AmbientLight(0xffffff, 0.6);
    scene.add(ambient);

    // 鼠标和键盘事件
    let controls = new OrbitControls(camera, renderer.domElement);//创建控件对象
    controls.enableDamping = true;

    // 创建坐标系
    var axisHelper = new THREE.AxesHelper(250);
    scene.add(axisHelper);

    // 底部栅格
    var gridHelper = new THREE.GridHelper(600, 50);
    gridHelper.position.y = -0.1;
    scene.add(gridHelper);

}

export default initScene;